//
//  TMTrimStringMacro.m
//  TMTrimString
//
//  Created by Anshu Chimala on 1/1/10.
//  Copyright 2010 Home. All rights reserved.
//

#import "TMTrimStringMacro.h"


@implementation TMTrimStringMacro
@synthesize delegate = _delegate;

- (NSString *)title {
	return @"Trim Whitespace/Newlines";
}

- (NSString *)author {
	return @"Anshu Chimala";
}

- (NSString *)description {
	return @"Trims whitespace and newline characters from the ends of your text.";
}

- (void)processText:(NSString *)text {
	text = [text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
	_delegate.shouldPasteAfterwards = YES;
	[_delegate macro:self didProcessTextWithResult:text];
}

- (NSString *)beforeText {
	return @"         Hello this is some text\r\n\r\n   <invisible character>";
}

- (NSString *)afterText {
	return @"Hello this is some text";
}

@end
